package com.ohuang.launcher.util;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class MethodUtil {

    public static Object invoke(Object o,String methodName){
        try {
            Method declaredMethod = o.getClass().getDeclaredMethod(methodName);
            return declaredMethod.invoke(o);
        } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
            e.printStackTrace();
        }
        return null;
    }
}
